import React, { useState } from 'react'
import { getList } from '../../api/yapi'

export default function RequestSample() {
  const [content, setContent] = useState('')

  const handleButtonclick = () => {
    alert('click')
    getList.then((res) => {
      console.log(res)
    })
  }

  return (
    <div>
      <div>RequestSample</div>
      <div>
        <button
          onClick={() => {
            handleButtonclick()
          }}
        >
          获取数据
        </button>
        <p>{content}</p>
      </div>
    </div>
  )
}
